﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media;

namespace Brilliants.UI
{
    public static class UIResource
    {
        /// <summary>
        /// 资源引用的索引
        /// </summary>
        public static int ResourceIndex { get; set; } = 0;

        public static Brush GetBrush(string key)
        {
            try
            {
                return System.Windows.Application.Current.Resources.MergedDictionaries[ResourceIndex][key] as Brush;
            }
            catch
            {
                return null;
            }
        }
    }
}
